package com.atguigu.day31.cookie03;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/cookieC")
public class CookieServletC extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("CookieServletC 请求到达了");
        Cookie[] cookies = req.getCookies();

        for (Cookie cookie : cookies) {
            System.out.println(cookie.getName()+","+cookie.getValue());
        }


        System.out.println("CookieServletC Success");

    }
}
